package com.cloudspace.jindun.rongyun;

import com.cloudspace.jindun.constants.Constants;
import com.cloudspace.jindun.utils.AppPreferences;

import java.util.List;

import io.rong.imkit.DefaultExtensionModule;
import io.rong.imkit.plugin.IPluginModule;
import io.rong.imlib.model.Conversation;

/**
 * User: Cloud(32325596@qq.com)
 * Date: 2017-01-16
 * Time: 13:05
 * project: jindunnew
 * Describe
 */
public class MyExtensionModule extends DefaultExtensionModule {
    private MyPlugin myPlugin;

    @Override
    public List<IPluginModule> getPluginModules(Conversation.ConversationType conversationType) {
        if (AppPreferences.getBoolean(Constants.GROUPCHAT_ON, true)) {
            myPlugin=new MyPlugin();
            List<IPluginModule> pluginModules =  super.getPluginModules(conversationType);
            pluginModules.add(myPlugin);

            return pluginModules;
        }

        return super.getPluginModules(conversationType);
    }

}
